// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()
const db = cloud.database();

// 云函数入口函数
exports.main = async (event, context) => {
  let data = {}
   await db.collection('job').where({
      _id:event.id,
    }).get().then(res=>{
      console.log("job",res)
      data.list = (res.data || [])[0]
    })

    await db.collection('user_job').where({
      jobId:event.id,
    }).get().then(res=>{
       console.log("user_job",res)
       data.userList = res.data
    })
    return data


}